package com.weiyuwqj.server.service.user.impl;

import com.github.pagehelper.PageHelper;
import com.weiyuwqj.api.common.PageList;
import com.weiyuwqj.api.common.Paginator;
import com.weiyuwqj.api.model.BusUserSuggestion;
import com.weiyuwqj.api.service.BusUserSuggestionService;
import com.weiyuwqj.server.mapper.BusUserSuggestionMapper;
import com.weiyuwqj.server.service.base.BaseServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Map;

/**
 * Created by lips on 2016/2/2.
 */
@Service("userSuggestionService")
public class BusUserSuggestionServiceImpl extends BaseServiceImpl<BusUserSuggestion> implements BusUserSuggestionService {

    @Autowired
    private BusUserSuggestionMapper suggestionMapper;

    @Override
    public PageList getList(Paginator p, Map<String, Object> map) {
        PageHelper.startPage(p.getPageNum(), p.getPageSize());
        return new PageList(suggestionMapper.getList(map));
    }

    @Override
    public int saveBean(BusUserSuggestion busUserSuggestion) {
        return suggestionMapper.saveBean(busUserSuggestion);
    }
}
